<template>
	<view class="content">
		<view class="ipts">
			<view class="record">
				<view class="">
					<image src="/static/jilu.png" mode=""></image>
					<text>用户信息</text>
				</view>

			</view>
			<!-- 户号 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>档案号</text>
				</view>
				<text class="place-class">{{d.user_text.meter_num}}</text>
			</view>
			<!-- 用户姓名 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>用户姓名</text>
				</view>
				<text class="place-class">{{d.user_text.username}}</text>
			</view>
			<!-- 户主姓名 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>户主姓名</text>
				</view>
				<text class="place-class">{{d.user_text.realname}}</text>
			</view>

			<!-- 身份证号 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>身份证号</text>
				</view>
				<text class="place-class">{{d.user_text.ID_num}}</text>
			</view>

			<!-- 联系方式 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>联系方式</text>
				</view>
				<view class="" style="display: flex;align-items: center;">
					<!-- <image src="/static/pagesB/tel.png" mode=""></image> -->
					<text class="place-class">{{d.user_text.mobile}}</text>
				</view>


			</view>

			<!-- 地址 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>地址</text>
				</view>
				<text class="place-class">{{d.user_text.address}}</text>
			</view>
			<!-- 通气日期 -->
			<!-- <view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>通气日期</text>
				</view>
				<text class="place-class">2021.02.12</text>
			</view> -->
		</view>
		<!-- 第二块 -->
		<view class="ipts">
			<!-- {调压}计量柜品牌 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>(调压)计量柜品牌</text>
				</view>
				<view class="flex alcenter" @tap="show1 = true">
					<input class="item-ipt" type="text" disabled v-model="d.meterage_brand" placeholder="请选择计量柜品牌" />
				</view>
			</view>
			<!-- 供气压力 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>供气压力</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.inlet_pressure" placeholder="请选择供气压力" />
			</view>
			<!-- 远传产品品牌 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>远传产品品牌</text>
				</view>
				<view class="flex alcenter" @tap="show2 = true">
					<input class="item-ipt" type="text" disabled v-model="d.product_brand" placeholder="请输入远传产品品牌" />
				</view>
			</view>
			<!-- 远传产品编号 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>远传产品编号</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.product_number" placeholder="请输入远传产品编号" />
			</view>
			<!-- 流量计品牌 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>流量计品牌</text>
				</view>
				<view class="flex alcenter" @tap="show3 = true">
					<input class="item-ipt" type="text" disabled v-model="d.flow_brand" placeholder="请输入流量计品牌" />
				</view>
			</view>
			<!-- 流量计类型 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>流量计类型</text>
				</view>
				<view class="flex alcenter" @tap="show4 = true">
					<input class="item-ipt" type="text" disabled v-model="d.flow_type" placeholder="请选择流量计类型" />
				</view>
			</view>
			<!-- 流量计型号 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>流量计型号</text>
				</view>
				<view class="flex alcenter" @tap="show5 = true">
					<input class="item-ipt" type="text" disabled v-model="d.flow_model" placeholder="请选择流量计型号" />
				</view>
			</view>
			<!-- 流量计编号 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>流量计编号</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.flow_number" placeholder="请输入流量计编号" />
			</view>
			<!-- 机械表底数 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>机械表底数</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.mechanical_base" placeholder="请输入机械表底数" />
			</view>
			<!-- 修正仪编号 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>修正仪编号</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.corrector_number" placeholder="请输入修正仪编号" />
			</view>
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>修正仪底数</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.corrector_base" placeholder="请输入修正仪底数" />
			</view>
			<!-- 本次检定日期 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>本次检定日期</text>
				</view>
				<view class="flex alcenter" @tap="show6 = true">
					<input class="item-ipt" type="text" disabled v-model="d.this_time" placeholder="请选择本次检定日期" />
				</view>
			</view>
			<!-- 下次检定日期 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>下次检定日期</text>
				</view>
				<view class="flex alcenter" @tap="show7 = true">
					<input class="item-ipt" type="text" disabled v-model="d.next_time" placeholder="请选择下次检定日期" />
				</view>
			</view>
			<!-- 油量 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>油量</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.petrol" placeholder="油量" />
			</view>
			<!-- 燃气具品牌 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>燃气具品牌</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.gas_brand" placeholder="品牌" />
			</view>
			<!-- 然机具种类 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>燃机具种类</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.gas_type" placeholder="种类" />
			</view>
			<!-- 功率 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>功率</text>
				</view>
				<input class="item-ipt" type="text" disabled v-model="d.power" placeholder="功率(w)" />
			</view>
			<!-- 流量计照片 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>流量计照片</text>
				</view>
				<view class="addform-items">
					<view class="" style="position: relative;" v-for="(i,index) in d.flow_images">
						<image class="form-img" :src="i" :key="index" @tap="seeimg(d.flow_images,index)">
						</image>
					</view>
				</view>
			</view>
			<!-- 燃气火点照片 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>燃气火点照片</text>
				</view>
				<view class="addform-items">
					<view class="" style="position: relative;" v-for="(i,index) in d.gas_fire_images">
						<image class="form-img" :src="i" :key="index" @tap="seeimg(d.gas_fire_images,index)">
						</image>
					</view>
				</view>
			</view>
			<!-- 资料照片 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>资料照片</text>
				</view>
				<view class="addform-items">
					<view class="" style="position: relative;" v-for="(i,index) in d.data_images">
						<image class="form-img" :src="i" :key="index" @tap="seeimg(d.data_images,index)">
						</image>
					</view>
				</view>
			</view>
			<!-- 设备照片 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>设备照片</text>
				</view>
				<view class="addform-items">
					<view class="" style="position: relative;" v-for="(i,index) in d.equipment_images">
						<image class="form-img" :src="i" :key="index" @tap="seeimg(d.equipment_images,index)">
						</image>
					</view>
				</view>
			</view>
			<!-- 其他照片 -->
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>其他照片</text>
				</view>
				<view class="addform-items">
					<view class="" style="position: relative;" v-for="(i,index) in d.other_images">
						<image class="form-img" :src="i" :key="index" @tap="seeimg(d.other_images,index)">
						</image>
					</view>
				</view>
			</view>
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>电子签名</text>
				</view>
				<view class="addform-items">
					<view class="" style="position: relative;" v-if="d.sign">
						<image class="form-img" :src="d.sign" @tap="seek(d.sign)">
						</image>
					</view>
				</view>
			</view>
			<view class="supplement">
				<view class="info-item" style="border-bottom: 0;">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>备注</text>
					</view>
				</view>
				<view class="explain">
					<textarea v-model="d.remarks" disabled maxlength="200" auto-height @input="textChange" class="textArea"
						placeholder="添加备注" style="font-size: 24rpx;color: #999;" />
				</view>
			</view>

		</view>
		<!-- 上次安检时间 -->
		<view class="ipts">
			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>是否安检</text>
				</view>
				<view class="danger-img-box">
					<switch :checked="d.is_safe==1?true:false" disabled style="transform:scale(0.7)" />
				</view>
			</view>

			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>是否签收《工商业用户安全检查记录表》</text>
				</view>
				<view class="danger-img-box">
					<view class="danger-img-box">
						<switch :checked="d.is_receive_inspect==1?true:false" disabled style="transform:scale(0.7)" />
					</view>
				</view>
			</view>

			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>是否签收《工商业用户安全隐患整改通知书》</text>
				</view>
				<view class="danger-img-box">
					<view class="danger-img-box">
						<switch :checked="d.is_receive_improving==1?true:false" disabled style="transform:scale(0.7)" />
					</view>
				</view>
			</view>

			<view class="info-item">
				<view class="info-item-left">
					<view class="dot"></view>
					<text>是否派发安全宣传资料</text>
				</view>
				<view class="danger-img-box">
					<view class="danger-img-box">
						<switch :checked="d.is_sell==1?true:false" disabled style="transform:scale(0.7)" />
					</view>
				</view>
			</view>

		</view>
	</view>
</template>

<script>
	export default {
		
		data() {
			return {
				d:{},  //获取的安检详情
			}
		},
		onShow() {

		},
		onLoad(e) {
			this.getDetails(e.id)
		},
		methods: {
			getDetails(id){
				var _this = this
				uni.request({
					url: _this.$url + '/staff.business/details',
					method:'GET',
					data:{
						id:id
					},
					success: (res) => {
						if(res.data.code==0) {
							return _this.$showToast(res.data.msg)
						}
						_this.d = res.data.data
					}
				})
			},
			seeimg(img, index) {
				let arr = []
				for (let i = 0; i < img.length; i++) {
					arr.push(img[i])
				}
				uni.previewImage({
					urls: arr,
					current: index,
					loop: true
				})
			},
			seek(img) {
				uni.previewImage({
					urls: [img]
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		background: #F1F1F1;
		padding-bottom: 100rpx;

		.header {
			display: flex;
			justify-content: space-between;
			align-items: center;
			// padding: 30rpx 30rpx;
			background-color: #F1F1F1;

			.header-right {
				display: flex;
				align-items: center;
				font-size: 24rpx;
				color: #333;
				// margin-right: 20rpx;
				padding: 10rpx 30rpx;

				image {
					width: 32rpx;
					height: 32rpx;
					margin-right: 10rpx;
				}
			}
		}

		.header1 {
			display: flex;
			align-items: center;
			box-sizing: border-box;
			height: 80rpx;
			width: 100%;
			background-color: #003690;
			padding: 0 30rpx;

			.ipt-box {
				display: flex;
				justify-content: space-between;
				align-items: center;
				box-sizing: border-box;
				padding: 0 20rpx;
				width: 450rpx;
				height: 52rpx;
				background-color: #fff;
				border-radius: 24rpx;

				image {
					width: 32rpx;
					height: 32rpx;
				}
			}

			.header1-right {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				color: #E2ECFB;
				flex: 1;
				justify-content: center;

				image {
					width: 36rpx;
					height: 36rpx;
				}
			}
		}

		.newstyle {
			background: #003690;
			color: #FFFFFF;
		}

		// 气表模块
		.gasmeter {
			display: flex;
			align-items: center;
			// justify-content: space-between;
			// padding: 20rpx 30rpx;
			background: #FFFFFF;
			border-bottom: 1rpx solid #eee;

			.renewal {
				width: 33.3%;
				height: 80rpx;
				line-height: 80rpx;
				text-align: center;
			}

		}

		.searShow {
			width: 360rpx;
			height: 254rpx;
			position: fixed;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);

			image {
				width: 100%;
				height: 100%;
			}
		}

		.dataCont {
			padding-top: 12rpx;
			padding-left: 42rpx;
			padding-right: 30rpx;

			.searTitle {
				font-size: 32rpx;
				font-weight: 600;
				text-align: left;
				color: #333333;
			}

			.searResult {
				display: flex;
				justify-content: space-between;

				.resText {
					font-size: 32rpx;
					font-weight: 400;
					text-align: left;
					color: #777777;
				}

				image {
					width: 36rpx;
					height: 36rpx;
				}
			}
		}

		.ipts {
			background-color: #fff;
			margin-bottom: 20rpx;

			.liaison {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 10rpx 30rpx;

				.left {
					display: flex;
					align-items: center;

					.shuxian {
						width: 8rpx;
						height: 28rpx;
						background: #003690;
						opacity: 1;
						border-radius: 200rpx;
						margin-right: 10rpx;
					}

					.name {
						font-size: 28rpx;
						font-family: Source Han Sans SC;
						font-weight: 500;
						color: #333333;
						margin-right: 10rpx;
					}

					.time {
						font-size: 24rpx;
						font-family: Source Han Sans SC;
						font-weight: 400;
						color: #777777;
					}
				}

				.right {
					display: flex;
					align-items: center;

					image {
						width: 32rpx;
						height: 32rpx;
						margin-right: 10rpx;
					}

					.phone {
						font-size: 24rpx;
						font-family: Source Han Sans SC;
						font-weight: 400;
						color: #555555;
					}
				}
			}
		}

		.info-item {
			box-sizing: border-box;
			display: flex;
			align-items: center;
			justify-content: space-between;
			width: 100%;
			padding: 0rpx 30rpx;
			background-color: #fff;
			font-size: 24rpx;
			color: #333;
			height: 100rpx;
			border-bottom: 1rpx solid #DDDDDD;

			image {
				width: 32rpx;
				height: 32rpx;
			}

			input {
				flex: 1;
				text-align: right;
			}

			.dot {
				width: 8rpx;
				height: 8rpx;
				background-color: #003690;
				border-radius: 50%;
				margin-right: 10rpx;
			}

			.danger-img {
				position: relative;

				.updeletes {
					position: absolute;
					top: -20rpx;
					right: -20rpx;
					width: 40rpx;
					height: 40rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					z-index: 88;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.danger-img-box {
				display: flex;

				.danger-img {
					width: 75rpx;
					height: 75rpx;
					// border: 2rpx dashed #eee;
					margin-right: 10rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.danger-img-box2 {
				display: flex;

				.danger-img {
					width: 75rpx;
					height: 75rpx;
					// border: 2rpx dashed #eee;
					margin-right: 10rpx;

					image {
						width: 100%;
						height: 100%;
						opacity: 1;
					}
				}
			}

			.info-item-left {
				display: flex;
				align-items: center;
				font-size: 28rpx;
			}

			.addform-items {
				display: flex;
				align-items: center;

				.delet {
					position: absolute;
					top: -8rpx;
					right: 4rpx;
					width: 28rpx;
					height: 28rpx;
					z-index: 10;
				}

				.form-img {
					width: 60rpx;
					height: 60rpx;
					margin-right: 20rpx;
				}

				.add {
					width: 60rpx;
					height: 60rpx;
					border: 1rpx solid #DDDDDD;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}

		.hengxian {
			width: 700rpx;
			height: 2rpx;
			background-color: #eee;
			margin: 20rpx auto;
		}

		.place-class {
			font-size: 28rpx;
			color: #999;
		}

		.btn {
			width: 646rpx;
			height: 80rpx;
			margin: 74rpx auto;
			text-align: center;
			line-height: 80rpx;
			border-radius: 40rpx;
			background-image: linear-gradient(to bottom, #2366D5, #001B48);
			font-size: 32rpx;
			color: #E5EFFE;
		}

		.btns {
			position: fixed;
			bottom: 0;
			display: flex;
			width: 100%;
			z-index: 333;

			.btn1 {
				width: 50%;
				height: 96rpx;
				line-height: 96rpx;
				text-align: center;
				font-size: 24rpx;
			}

			.consel {
				background-color: #e9e9e9;
				color: #777;
			}

			.save {
				background-color: #003690;
				color: #fff;
			}
		}

		.btn:active {
			background: rgba(0, 0, 0, 0.4);
		}

		.zhanwei {
			height: 250rpx;
		}

		.record {
			display: flex;
			align-items: center;
			justify-content: space-between;
			color: #003690;
			font-size: 32rpx;
			padding-top: 20rpx;

			.right {
				width: 394rpx;
				height: 52rpx;
				background: #F2F2F2;
				opacity: 1;
				border-radius: 50rpx;
			}

			image {
				width: 32rpx;
				height: 32rpx;
				margin: 0 20rpx 0 30rpx;
			}
		}

		.record-item {
			display: flex;
			justify-content: space-between;
			padding: 10rpx 30rpx;
			border-bottom: 2rpx solid #eee;

			.record-item-left {
				display: flex;
				align-items: center;

				.shu {
					width: 8rpx;
					height: 28rpx;
					background-color: #003690;
					border-radius: 8rpx;
				}

				.title {
					font-size: 32rpx;
					color: #333;
					font-weight: 500;
					margin: 0 10rpx;
				}

				.time {
					font-size: 24rpx;
					color: #777;
				}
			}

			.record-item-right {
				display: flex;
				align-items: center;

				.dianhua {
					width: 28rpx;
					height: 28rpx;
				}

				.zhankai {
					width: 36rpx;
					height: 36rpx;
				}

				.title {
					font-size: 32rpx;
					color: #555;
					font-weight: 500;
					margin: 0 10rpx;
				}
			}
		}

		.supplement {
			margin: 20rpx 24rpx;
			background-color: #fff;
			position: relative;
			overflow: hidden;

			.explain {
				.textArea {
					min-height: 142rpx;
					padding: 14rpx 30rpx;
					font-size: 32rpx;
					text-align: left;
					color: rgba(187, 187, 187, 0.84);
				}
			}

			.suppBottom {
				.danger-img {
					position: relative;
					margin-left: 50rpx;
					margin-bottom: 0rpx;
					width: 68rpx;
					height: 68rpx;
					float: left;

					image {
						width: 36rpx;
						height: 36rpx;
						position: absolute;
						left: 50%;
						top: 50%;
						transform: translate(-50%, -50%);
					}
				}

				.num {
					float: right;
					margin-right: 26rpx;
				}
			}
		}
	}

	.history {
		margin-top: 18rpx;
		padding: 20rpx;
		background: #FFFFFF;
		display: flex;
		align-items: center;
		.historyicon{
			width: 33rpx;
			height: 32rpx;
		}
		.text{
			margin-left: 12rpx;
			font-size: 28rpx;
			font-family: Source Han Sans SC;
			font-weight: 500;
			color: #003690;
		}
	}
</style>
